import request from "@/utils/request";

export const miniLogin = (data) => {
  return request({
    url: "/mini/loginMini",
    method: "GET",
    data,
  });
};

// 发送验证码
export const sendCode = (data) => {
  return request({
    url: "/mini/sms",
    method: "GET",
    data,
  });
};

export const tokenLogin = (data) => {
  return request({
    url: "/mini/getAccessToken",
    method: "POST",
    data,
  });
};

// 首页换电列表
export const getHomeList = (data) => {
  return request({
    url: "/home/findByStationList",
    method: "POST",
    data,
  });
};

// 用户反馈
export const feedback = (data) => {
  return request({
    url: "/home/saveFeedback",
    method: "POST",
    data,
  });
};

// 反馈历史
export const feedbackHistory = (data) => {
  return request({
    url: "/home/findByFeedbackList",
    method: "POST",
    data,
  });
};

// 反馈历史详情
export const feedbackHistoryDetail = (data) => {
  return request({
    url: "/home/findByFeedbacId",
    method: "GET",
    data,
  });
};

// 行驶证OCR识别
export const orc = (data) => {
  return request({
    url: "/home/vehicleLicense",
    method: "GET",
    data,
  });
};

// 车辆绑定
export const postBindCar = (data) => {
  return request({
    url: "/home/saveVehicle",
    method: "POST",
    data,
  });
};

// 订单列表
export const orderList = (data) => {
  return request({
    url: "/home/findByMyorderList",
    method: "POST",
    data,
  });
};

// 订单支付
export const orderPay = (data) => {
  return request({
    url: "/home/orderPay",
    method: "POST",
    data,
  });
};

// 站点详情
export const stationDetail = (data) => {
  return request({
    url: "/home/findByStationId",
    method: "POST",
    data,
  });
};

// 电池详情
export const batteryDetail = (data) => {
  return request({
    url: "/home/finByBatteryInfo",
    method: "GET",
    data,
  });
};

// 获取用户详情
export const userDetail = (data) => {
  return request({
    url: "/home/userInfo",
    method: "GET",
    data,
  });
};

// 修改用户信息
export const upDateUser = (data) => {
  return request({
    url: "/home/updateUser",
    method: "POST",
    data,
  });
};

// 车辆绑定列表
export const carBindList = (data) => {
  return request({
    url: "/home/findByVehicleList",
    method: "GET",
    data,
  });
};

// 获取已开通城市列表
export const getOpenCityList = (data) => {
  return request({
    url: "/home/findByOpenCityList",
    method: "GET",
    data,
  });
};

// 收钱吧支付
export const pay = (data) => {
  return request({
    url: "/order/pay",
    method: "GET",
    data,
  });
};

// 解绑车辆
export const carUnBind = (data) => {
  return request({
    url: "/home/unbind",
    method: "GET",
    data,
  });
};
